﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace SelfService.DataAccess.Migrations
{
    public partial class 更新挂号表 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "Fee",
                table: "SysAppointments");

            migrationBuilder.RenameColumn(
                name: "TimeSelection",
                table: "SysAppointments",
                newName: "TimeSelectionStartTime");

            migrationBuilder.RenameColumn(
                name: "RegDate",
                table: "SysAppointments",
                newName: "TimeSelectionEndTime");

            migrationBuilder.AlterColumn<decimal>(
                name: "TreatFee",
                table: "SysAppointments",
                type: "decimal(65,30)",
                nullable: false,
                defaultValue: 0m,
                oldClrType: typeof(string),
                oldType: "longtext",
                oldNullable: true)
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<DateTime>(
                name: "AppointmentDate",
                table: "SysAppointments",
                type: "datetime(6)",
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "AppointmentFee",
                table: "SysAppointments",
                type: "decimal(65,30)",
                nullable: false,
                defaultValue: 0m);

            migrationBuilder.AddColumn<int>(
                name: "Status",
                table: "SysAppointments",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<int>(
                name: "Type",
                table: "SysAppointments",
                type: "int",
                nullable: false,
                defaultValue: 0);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "AppointmentDate",
                table: "SysAppointments");

            migrationBuilder.DropColumn(
                name: "AppointmentFee",
                table: "SysAppointments");

            migrationBuilder.DropColumn(
                name: "Status",
                table: "SysAppointments");

            migrationBuilder.DropColumn(
                name: "Type",
                table: "SysAppointments");

            migrationBuilder.RenameColumn(
                name: "TimeSelectionStartTime",
                table: "SysAppointments",
                newName: "TimeSelection");

            migrationBuilder.RenameColumn(
                name: "TimeSelectionEndTime",
                table: "SysAppointments",
                newName: "RegDate");

            migrationBuilder.AlterColumn<string>(
                name: "TreatFee",
                table: "SysAppointments",
                type: "longtext",
                nullable: true,
                oldClrType: typeof(decimal),
                oldType: "decimal(65,30)")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "Fee",
                table: "SysAppointments",
                type: "longtext",
                nullable: true)
                .Annotation("MySql:CharSet", "utf8mb4");
        }
    }
}
